# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import api, fields, models, _
from odoo.exceptions import ValidationError


class InternalChangeLevel(models.Model):
    _name = 'internal.change.level'
    _description = 'Internal Change Level'
    _order = 'name'

    name = fields.Char(string='Level')

    def _create_if_not_exist(self, code):
        level = self.search([('name', '=', code)])
        if not level:
            level = self.create({'name': code})
        return level